package com.itheima.model.vo;

import com.itheima.model.pojo.UserInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class FriendsVo {

    private Long id;
    private String avatar;
    private String nickname;
    private String gender;
    private Integer age;
    private String city;
    private String education;
    private Integer marriage;

    private Boolean alreadyLove;

    private Integer matchRate = 50;

    public static FriendsVo init(UserInfo userInfo, Boolean flag) {
        FriendsVo vo = new FriendsVo();
        BeanUtils.copyProperties(userInfo, vo);

        vo.setAlreadyLove(flag);

        return vo;
    }

}
